package chapter04

import chisel3._
import chisel3.util._

class MyQueue extends Module {
  val io = IO(new Bundle {
    val in = Flipped(Decoupled(UInt(8.W)))
    val out = Decoupled(UInt(8.W))
    val cnt = Output(UInt(4.W))
  })
  val q = Module(new Queue(UInt(8.W), entries = 16))
  q.io.enq <> io.in
  io.out <> q.io.deq
  io.cnt := q.io.count
}